/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.liquidByte.trafficMustang.server.dataModel;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Alexandre
 */
@Embeddable
public class UsuarioTelefonePK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "USR_ID")
    private int usrId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 16)
    @Column(name = "USR_TEL_NM")
    private String usrTelNm;

    public UsuarioTelefonePK() {
    }

    public UsuarioTelefonePK(int usrId, String usrTelNm) {
        this.usrId = usrId;
        this.usrTelNm = usrTelNm;
    }

    public int getUsrId() {
        return usrId;
    }

    public void setUsrId(int usrId) {
        this.usrId = usrId;
    }

    public String getUsrTelNm() {
        return usrTelNm;
    }

    public void setUsrTelNm(String usrTelNm) {
        this.usrTelNm = usrTelNm;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) usrId;
        hash += (usrTelNm != null ? usrTelNm.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof UsuarioTelefonePK)) {
            return false;
        }
        UsuarioTelefonePK other = (UsuarioTelefonePK) object;
        if (this.usrId != other.usrId) {
            return false;
        }
        if ((this.usrTelNm == null && other.usrTelNm != null) || (this.usrTelNm != null && !this.usrTelNm.equals(other.usrTelNm))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.liquidByte.trafficMustang.server.dataModel.UsuarioTelefonePK[ usrId=" + usrId + ", usrTelNm=" + usrTelNm + " ]";
    }
    
}
